import datetime

from django.http import HttpResponse, response
from django.shortcuts import render, render_to_response


# Create your views here.



#联系我们
def contact(request):
    if request.method == "POST":
        print('buyinggai')
        name_form = request.POST.get('name')
        email_form = request.POST.get('email')
        message_form = request.POST.get('message')
        print(name_form,email_form,message_form)
        return render_to_response('contact.html')
    elif request.method == "GET":
        return render_to_response('contact.html')

#记录页
def record(request):
    return render_to_response('record.html')
def sayHello(request):
    s = 'Hello World!'
    current_time = datetime.datetime.now()
    html = '''
            <html>
            <head>
            </head>
            <body>
            <h1>
            %s
            </h1>
            <p>
            %s
            </p>
            </body>
            </html>
        ''' % ( s , current_time )

    #return HttpResponse(html)
    return render_to_response('indexback.html')
def testPage(request):
    return render_to_response('AdminIndex.html')

def testChart(request):
    data1 = [120, 132, 101, 134, -90, 230, 210]
    data2 = [20, 232, 11, -144, 90, 30, 90]
    data3 = [180, -12, 161, 84, 60, 230, -10]


    jd1 = {}
    jd1["测试数据1"] = data1
    jd2 = {}
    jd2["测试数据2"] = data2
    jd3 = {}
    jd3["测试数据3"] = data3



